package com.topscomm.gpm.controller;

import com.topscomm.tap.common.DatacodeCache;
import com.topscomm.pub.vo.ResponseResult;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * echarts图表接口
 * @author liuchenguang
 * @version 1.0
 * @description:
 * @date 2021/1221 14:13
 */
@RestController
@RequestMapping("/sd/echarts")
public class GpmEchartsController {

    /**
     * datacodelist方法
     *
     * @description:
     * @param paraMap
     * @return
     * @author: liuchenguang
     * @date: 2021年12月21
     * @modify:
     */
    @GetMapping(value = "/dataCodeList")
    public ResponseResult<Object> dataCodeList(@RequestParam(required = false) Map<String, Object> paraMap) {
        Map<String,Object> codeMap = new HashMap<>();
        DatacodeCache datacodeCache = new DatacodeCache();
        List<Map<String, Object>> productEchartsTypeList = datacodeCache.getCodeListMap("GpmProductEchartsType", "", "sortcode");
        codeMap.put("productEchartsTypeList", productEchartsTypeList);
        return ResponseResult.ok(codeMap);
    }
}
